package com.itheima;

import java.util.Calendar;

public class CalenderDemo {
    public static void main(String[] args) {
        Calendar cld= Calendar.getInstance();
        System.out.println("年"+cld.get(Calendar.YEAR));
        System.out.println("月"+(cld.get(Calendar.MONTH)+1));
        System.out.println("日"+cld.get(Calendar.DATE));
        cld.add(Calendar.YEAR,-3);
        System.out.println("- - -- -  - ");
        System.out.println("年"+cld.get(Calendar.YEAR));
        System.out.println("月"+(cld.get(Calendar.MONTH)+1));
        System.out.println("日"+cld.get(Calendar.DATE));
        cld.set(2010,10,12);
        System.out.println(cld.get(Calendar.YEAR));
    }
}
